package com.treeman.friend;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.treeman.user.User;

@Entity
@Table(name = "INVITATION")
public class Invitation implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@Basic(optional = false)
	@ManyToOne(targetEntity = User.class)
	@JoinColumn(name = "FROM_USER_ID", nullable = false)
	private User from;

	@Id
	@Basic(optional = false)
	@ManyToOne(targetEntity = User.class)
	@JoinColumn(name = "TO_USER_ID", nullable = false)
	private User to;

	public Invitation(User from, User to) {
		this.from = from;
		this.to = to;
	}

	public Invitation() {
	}

	public User getTo() {
		return to;
	}

	public void setTo(User to) {
		this.to = to;
	}

	public User getFrom() {
		return from;
	}

	public void setFrom(User from) {
		this.from = from;
	}

}
